package com.a.module_home

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.a.module_home.databinding.ItemHomeBinding

class HomeRvAdapter(list: MutableList<Home>) : BaseQuickAdapter<Home, BaseViewHolder>(R.layout.item_home,list) {
    override fun onItemViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        DataBindingUtil.bind<ItemHomeBinding>(viewHolder.itemView)
    }

    override fun convert(holder: BaseViewHolder, item: Home) {
        val binding = DataBindingUtil.getBinding<ItemHomeBinding>(holder.itemView) ?: return
        binding.m = item
        binding.executePendingBindings()
    }
}